<?php
require_once 'includes/include_dao.php';
$tag = DAOFactory::getTagDAO()->load($_GET['tag']);
$template = DAOFactory::getTemplateDAO()->load($tag->template); 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Tag</title>
<link href="includes/css/screen.css" type="text/css" rel="stylesheet" media="screen,projection" />
</head>
<body>
<div id="layout">
  <div id="header">
    <h1 id="logo"><a href="/" title="Access the HOME page">sparked<span> </span></a></h1>
    <hr class="noscreen" />
    <div id="navigation">
      <ul>
        <li><a href="/" title="HOME">HOME</a></li>
        <li><a href="/templates.php" title="TEMPLATES">TEMPLATES</a></li>
        <li><a href="/tags.php" title="TAGS">TAGS</a></li>
      </ul>
    </div>
    <hr class="noscreen" />
  </div>
  <div class="banner-box">
    <div class="banner-box-content">
      <div class="content">
        <h2>Tag</h2>
        <p>The tag <strong><?php echo $tag->label; ?></strong> is a unique label to access the kickstart file (<a href="/template.php?template=<?php echo $template->template; ?>"><?php echo $template->title; ?></a>). The kickstart can be downloaded using it's defined tags.</p>
        <a href="/download.php?tag=<?php echo $tag->tag; ?>" class="light">Download</a> <a href="/template.php?template=<?php echo $tag->template; ?>" class="light">View Template</a> <a href="/tag/delete.php?tag=<?php echo $tag->tag; ?>&amp;action=delete" class="light">Delete</a></div>
      <div id="box-right">
        <div id="box-right-content">
          <p><span>Download Using Tag Label</span><br />
            <a href="/download.php?label=<?php echo $tag->label; ?>"><?php echo htmlentities('http://' . $_SERVER['SERVER_NAME'] . '/download.php?label=' . $tag->label); ?></a><br />
            <span>Download Using Tag ID</span><br />
            <a href="/download.php?tag=<?php echo $tag->tag; ?>"><?php echo htmlentities('http://' . $_SERVER['SERVER_NAME'] . '/download.php?tag=' . $tag->tag); ?></a></p>
        </div>
      </div>
    </div>
    <div class="banner-bottom"></div>
  </div>
  <div id="main">
    <h2><?php echo $tag->label; ?></h2>
    <p>Below is the template that this unique tag connects to. <a href="/template.php?template=<?php echo $tag->template; ?>">View Template</a> </p>
    <h3><?php echo $template->title; ?></h3>
    <p> </p>
    <pre><code><?php echo strip_tags($template->document); ?></code></pre>
    <p></p>
  </div>
</div>
<div id="footer">
  <div id="footer-inside">
    <p id="copyright"><a href="http://code.google.com/p/sparked/" title="View Google Code Project" target="_blank">&copy;<?php echo date('Y'); ?> All Rights Reserved.</a></p>
  </div>
  <div style="clear: both;"></div>
</div>
</body>
</html>
